import { http } from '@/utils/http'

// 自提点信息
export const selfInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/group/store',
    data,
  })
}

// 申请团长
export const applyGroup = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'user/group/apply',
    data,
  })
}

//用户信息
export const userInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/info',
    data,
  })
}

// 用户钱包
export const userWallet = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/wallet',
    data,
  })
}

// 用户下单地址
export const userAddress = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/address-order',
    data,
  })  
}
// 创建订单
export const createOrder = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/create',
    data,
  })  
}

// 用户下单可用货币
export const currency = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'order/wallet-goods',
    data,
  })  
}
// 更新提货人
export const updatePickUp = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'user/pickup-info-set',
    data,
  }) 
}
// 订单支付
export const orderPay = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/pay',
    data,
    header: {'content-type': 'application/json'}
  })
}
// 订单列表
export const orderLists = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'order/list',
    data,
    header: {'content-type': 'application/x-www-form-urlencoded'}
  })  
}
// 订单状态列表
export const orderStatus = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'order/static-status-count',
    data,
  }) 
}

// 订单信息
export const orderInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'order',
    data,
  })
}

// 取消订单
export const orderCancel = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/cancel',
    data,
  }) 
}

// 申请退款
export const orderRefund = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/apply-refund',
    data,
  })  
}

// 地址列表
export const addressList = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/address',
    data,
  })  
}

// 添加地址
export const addressAdd = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'user/address-save',
    data,
  })  
}

// 删除地址
export const addressDel = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'user/address-delete',
    data,
  })
}

// 签到信息
export const signInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/clock-in-list',
    data,
  })  
}

// 发货前退款
export const orderRefundBefore = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/apply-refund',
    data,
  })  
}

// 积分商品库
export const integralGoods = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'goods/store',
    data,
  })  
}

// 优惠券列表
export const couponList = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/wallet-coupon',
    data,
  })  
}

// 优惠券获取详情
export const couponInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/wallet-coupon-detail',
    data,
  }) 
}

// 钱包明细
export const walletDetail = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/wallet-detail',
    data,
  })  
}

// 图片上传
export const uploadImg = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'file/upload-image',
    data,
    header: {'content-type': 'multipart/form-data' }
  })
}

// 申请团长状态
export const applyGroupStatus = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'user/group/apply-status',
    data,
  })
}

// 更新用户信息
export const updateUserInfo = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'user/profile-update',
    data,
  }) 
}

// 统计数据
export const statisticsData = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/static',
    data,
  })
}

// 我的团员
export const myTeam = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/member-list',
    data,
  })
}

// 团单列表
export const teamOrderList = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/order-list',
    data,
  })  
}

// 团单订单详情
export const teamOrderInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/order-detail',
    data,
  }) 
}

// 团长个人中心
export const groupInfo = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/personal',
    data,
  })  
}

// 佣金明细
export const commissionDetail = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/commission-list',
    data,
  })  
}

// 申请提现
export const applyWithdraw = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'group/cashout-apply',
    data,
  })  
}

// 提现列表
export const withdrawList = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'group/cashout-list',
    data,
  })  
}

// 绑定团长
export const bindGroup = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'user/group-bind',
    data,
  })
}

// 申请退款
export const applyrefund = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/refund',
    data,
  })  
}

// 团长订单签收
export const orderSign = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'group/order-sign',
    data,
  }) 
}

// 直播间列表
export const roomList = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'api/user/live/list',
    data,
    urlType: 'live'
  })  
}

// 订单签收（完成）
export const orderSignComplete = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'order/complete',
    data,
  })  
}

// 可用优惠券
export const couponListAvailable = (data?:Recordable) => {
  return http({
    method: 'GET',
    url: 'order/goods-can-use-coupon',
    data,
  })
}

// 订单核销
export const orderWriteOff = (data?:Recordable) => {
  return http({
    method: 'POST',
    url: 'group/order-write-off',
    data,
  }) 
}
